package com.cy.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.cy.entity.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author cy
 * @since 2021-11-08
 */
public interface MessageMapper extends BaseMapper<Message> {

    IPage<Message> selectConversations(Integer userId, Page<Message> page);

    Integer selectConversationCount(Integer userId);

    IPage<Message> selectLetters(String conversationId, Page<Message> page);

    Integer selectLettersCount(String conversationId);

    Integer selectLettersCountUnreadCount(Integer userId, String conversationId);


    Integer updateStatus(List<Integer> ids, Integer status);

    Message selectLatestNotice(int userId, String topic);

    List<Message> selectNotices(int userId, String topic, int offset, int limit);
}
